import Axios from "axios";
import Qs from 'qs'
Axios.default.withCredentials=true;
export default {
    /**
     * 获取用户列表
     */
    getAllUser: function ({ currentPage, pageSize , status , userName}) {
    const params={
    page : currentPage,
    rows : pageSize,
    status : status,
    name : userName
    };
    return Axios.post('/crawler/api/user/searchUserByCondition', Qs.stringify(params),{headers: {'Content-Type': 'application/x-www-form-urlencoded'}});
    },
    updateUser : function (params){
     return Axios.post('/crawler/api/user/updateUser', params);
    },
    addUser : function (params){
     return Axios.post('/crawler/api/user/regist', params);
    },
    deleteUser : function ({userId}) {
      const params = {
        id: userId
      }
      ;
      return Axios.post('/crawler/api/user/deleteUserById', Qs.stringify(params), {headers: {'Content-Type': 'application/x-www-form-urlencoded'}});
    }

}
